-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generate correct output on NumCPU() when using cgroups2 #9816
Conversation
|
Welcome @nickorlow! |
Hi @nickorlow. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Hi @nickorlow , Thanks for this. Please explore contributing tests for this. regards |
/triage accepted |
Should we include the tests in this PR or make a separate one? |
I think that the change and the e2e-test in this PR will help feedback. thanks |
Thank you for your contribution |
LGTM for the moment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything seems to be cgroup2 Unified Mode compatible and cgroup1.
Otherwise it fallback to no limit.
LGTM
test/e2e/cgroups/cgroups.go
Outdated
file.WriteString("4 2") | ||
file.Sync() | ||
|
||
assert.Equal(ginkgo.GinkgoT(), runtime.GetCgroupVersion(), int64(2)) | ||
assert.Equal(ginkgo.GinkgoT(), runtime.NumCPU(), 2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you set a more complex and more realistic test, for cgroups v1 and v2.
Something like "50000 100000" to get a NumCPU at 0,5 ?
@nickorlow @tao12345666333 Looks like this is stalled/forgotten? |
I think so.. anything more I need to do to have this merged? I believe all requested changes have been made |
Any news? |
✅ Deploy Preview for kubernetes-ingress-nginx canceled.
|
Any plans to have this merged? Thanks! |
@nickorlow Sorry for the long long delay, could you please resolve the conflicts and make a rebase? |
@nickorlow , can we get this through, please? thank you :) |
@tao12345666333 Everything updated. Had to make some changes to the tests since docker mounts the cgroup directory as ro unless you run it in privileged mode. |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: LeMyst, nickorlow, strongjz The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/cherry-pick release-1.11 |
@strongjz: once the present PR merges, I will cherry-pick it on top of release-1.11 in a new PR and assign it to you. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Are there any updates on this topic? What is preventing the merge of this PR? |
@strongjz: #9816 failed to apply on top of branch "release-1.11":
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Updates the NumCPU() function in pkg/util/runtime/cpu_linux.go to work with cgroups2.
What this PR does / why we need it:
Change is required for proper functionality with cgroups2.
Types of changes
Which issue/s this PR fixes
Fixes #9665
How Has This Been Tested?
Generated example files that were within the [cgroups2 spec](https://docs.kernel.org/admin-guide/cgroup-v2.html and
tested our code to ensure it returned the correct outputs for each case.
Checklist:
Does my pull request need a release note?